Filter and list all the table objects based on the value of TestResult of the table

Dear Mentors,

I'm a new to DOORS and trying to wirte a DXL script now, hereunder are the requirements:

Three formal modules A, B, C. I need get the baseline 1.2 of module A with two filters: attribute1=Yes, attribute2=True for it.
I need find all the module A's inlinks from module B and module C. the inlink objects are tables.

ReqID Description TestResult
TS1 ***** Pass
TS2 ***** Fail
TS3 ***** N/A

I need list all the objects which TestResult are Fail or N/A

Could you guide me how to realize it?

Thanks in Advance.


Happy2018 - Sat Dec 29 01:16:16 EST 2018

Re: Filter and list all the table objects based on the value of TestResult of the table
Happy2018 - Tue Jan 08 03:23:52 EST 2019

In the Module A opened with the right baseline, I use Analysis->wizard to add the Object Heading and Object text of Module B and C to display as two columns.

Now my thinking of the solution is:

1. for each object text, if it contains "TS",  object id + 2, and jump to the third column"TestResult"

2. then use upper to change the string into uppercase

3. if it not equal PASS, print the object.

Got the current layout DXL as below:

pragma runLim, 0
string limitModules[1] = {"4e0845f410a1519f-0000fa65"}
int lines[1] = {0}
void adjustLines(int depth, showAtDepth) {
    int count
    for (count = 0; count < 1; count++) {
        while (lines[depth-1] < lines[count]) {
            if (depth == showAtDepth) displayRich("\\pard " " ")
            lines[depth-1]++
        }
    }
}
void showIn(Object o, int depth) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
    string linkModName = "*"
    for lr in all(o<-linkModName) do {
        otherMod = module (sourceVersion lr)
        if (!null otherMod) {
            if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
                if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
                load((sourceVersion lr),false)
            }
        }
    }
    for l in all(o<-linkModName) do {
        otherVersion = sourceVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
        othero = source l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = source l
        if (null othero) continue
        if (isDeleted othero) continue
        int oldLines = lines[depth-1]
        adjustLines(depth, 1)
        bool kick = (doneOne) && (lines[depth-1] == oldLines)
        if (kick) {
            lines[depth-1]++
            if (depth == 1) displayRich("\\pard " " ")
        }
        if (depth < 1) {
            showIn(othero, depth+1)
        }
        doneOne = true
        if (depth == 1) {
            s = name(otherMod)
            if (isBaseline(otherVersion)) {
                s = s " [" versionString(otherVersion) "]"
            }
            if (s == "")
            displayRich("\\pard " " ")
            else
            displayRich("\\pard " s)
            s = probeRichAttr_(othero,"Absolute Number", false)
            if (s == "")
            displayRich("\\pard " " ")
            else
            displayRich("\\pard " s)
            s = probeRichAttr_(othero,"Object Heading", false)
            if (s == "")
            displayRich("\\pard " " ")
            else
            displayRich("\\pard " s)
            s = probeRichAttr_(othero,"Object Text", false)
            if (s == "")
            displayRich("\\pard " " ")
            else
     //       if(s contains "TS") {  

 
   
   }
        }
        lines[depth-1] += 4
    }
}
showIn(obj,1)